var server_config=require("../server_config");
var netbus=require("../../netbus/netbus");
var service_manager=require("../../netbus/service_manager");
var gameSysModule=require("./gameSysModule");


//启动系统服务器
var gameSys_server=server_config.gameSys_server;

if (gameSys_server.ntype==server_config.NetType.TCP)
	netbus.tcp_server(gameSys_server.host,gameSys_server.port,false);
else
	netbus.ws_server(gameSys_server.host,gameSys_server.port,false);

//注册验证模块
service_manager.register_service(server_config.Stype.GameSys, gameSysModule);


//连接系统数据库sql
var database_sql=server_config.database_sql;
var sql_gameSys=require("../../database/sql_gameSys");
sql_gameSys.connect(database_sql.host,
					database_sql.port,
					database_sql.db_name,
					database_sql.uname,
					database_sql.upwd);

//连接系统数据库redis
/*var database_redis=server_config.database_redis;
var redis_gameSys=require("../../database/redis_gameSys");
redis_gameSys.connect(database_redis.host,
					database_redis.port,
					database_redis.db_index);
					*/